package com.ibm.tivoli.swat.tsam_ec2.tsam;

import javax.ws.rs.core.MultivaluedMap;

import com.ibm.tivoli.swat.tsam_ec2.tsam.TSAMWebServiceClient.Ticket;
import com.sun.jersey.core.util.MultivaluedMapImpl;

public class QueryParam {
	private MultivaluedMap<String, String> map;
	private int counter = 0;
	private String ticketUid;
	
	public QueryParam (String srId, Ticket ticket) {
		map = new MultivaluedMapImpl();
		map.add("PMSCCRID", srId);
		map.add("SOURCE", "TSAMWEBUI");
		map.add("TICKETID", ticket.ticketId);
		map.add("TICKETUID", ticket.ticketUid);
		ticketUid = ticket.ticketUid;
	}

	//map.add("TICKETSPEC.1.ASSETATTRID", "PMRDPCLCPR_SERVICEINSTANCEID");
	//map.add("TICKETSPEC.1.NUMVALUE", instance.serviceInstanceId);
	//map.add("TICKETSPEC.1.REFOBJECTID", ticket.ticketUid);
	//map.add("TICKETSPEC.1.SECTION", " ");
	public void addTicketSpec (String assetAttrId, String type, String value) {
		counter++;
		map.add("TICKETSPEC." + counter + ".ASSETATTRID", assetAttrId);
		map.add("TICKETSPEC." + counter + "." + type, value);
		map.add("TICKETSPEC." + counter + ".REFOBJECTID", ticketUid);
		map.add("TICKETSPEC." + counter + ".SECTION", " ");
		
	}

	public MultivaluedMap<String, String> getMap () {
		return map;
	}
}
